<template>
    <div class="container hospital-list">
        <div class="record-card hd-shadow" v-for="(item, index) in medicalrecordlist" :key="index">
            <div class="item-left van-hairline--right">
                <div class="title">{{item.name}}</div>
                <div class="time"><van-icon name="clock" />{{item.create_time}}</div>
            </div>
            <div class="price"><em>¥</em>{{item.price}}</div>
        </div>
        <div class="record-card hd-shadow">
            <div class="item-left van-hairline--right">
                <div class="title">沈阳盛京医院</div>
                <div class="time"><van-icon name="clock" />2019-12-23 23:14</div>
            </div>
            <div class="price"><em>¥</em>2000</div>
        </div>
        <van-tabbar v-model="active" style="z-index:2;">
            <van-tabbar-item icon="dianfuyewu" to="/guarantee_medical_index">垫付医疗</van-tabbar-item>
            <van-tabbar-item icon="hezuoyiyuan" to="/guarantee_medical_hospital">合作医院</van-tabbar-item>
            <van-tabbar-item icon="shiyongshuoming" to="/guarantee_medical_tips">使用说明</van-tabbar-item>
            <van-tabbar-item icon="jiuyixuqiu" to="/guarantee_medical_record">就医记录</van-tabbar-item>
            <van-tabbar-item icon="mujuanzijin" to="/guarantee_medical_fund">爱心募捐</van-tabbar-item>
        </van-tabbar>
    </div>
</template>

<script>
export default {
  name: 'hospital',
  data () {
    return {
      value: 1,
      medicalrecordlist: []
    }
  },
  methods: {
    init () {
      this.$http({
        fun: 'medicalrecordlist',
        requestType: 'get',
        cb: res => {
          console.log(res)
          this.medicalrecordlist = res.results
          this.medicalrecordlist.forEach(item => {
            console.log('111')
          })
        }
      })
    },
    info (item) {
      console.log(item.id)
      this.$router.push({
        name: 'news_detail',
        query: {
          'id': item.id
        }
      })
    }
  },

  mounted () {
    this.init()
  }
}
</script>

<style src="./index.css" scoped>
</style>
